/**
 * @title AttentionMatchDoneListCommunicater.java
 * @package com.esun.cheetah.biz.personal.attention
 * @description 获取已完场的关注比赛列表
 * @author liugan
 * @date 2012-5-8
 * @copyright 深圳市易讯天空
 */
package com.esun.cheetah.biz.personal.attention;

import java.util.HashMap;

import com.esun.cheetah.biz.personal.personalinfo.UserInfo;
import com.esun.cheetah.config.BizCode;
import com.esun.cheetah.config.Config;
import com.esun.cheetah.config.Key;
import com.esun.cheetah.model.personal.attention.AttentionGameInfo;
import android.os.Handler;

/**
 * @title AttentionMatchDoneListCommunicater
 * @description 获取已完场的关注比赛列表
 * @author liugan
 */
public class AttentionMatchDoneListCommunicater extends
		AbsAttentionMatchListCommunicater {

	/**
	 * @param handler
	 */
	public AttentionMatchDoneListCommunicater(Handler handler) {
		super(handler);
	}

	@Override
	public HashMap<String, String> comHashMap() {
		HashMap<String, String> gainUserAttentionMap = new HashMap<String, String>();
		gainUserAttentionMap.put(Key.KEY_ID, BizCode.BIZCODE_GAIN_MATCH);
		gainUserAttentionMap.put(Key.KEY_USERNAME, UserInfo.getUserInfo()
				.getUserName());
		gainUserAttentionMap.put(Key.KEY_LOTID, Key.ZQ);
		gainUserAttentionMap.put(Key.KEY_CLASSIFY, Key.KEY_OVER);

		return gainUserAttentionMap;
	}

	@Override
	public void getServerResponseSuccess() {
		AttentionListManager.getInstance().setAttentionListDone(
				attentionMatchList);
		handlerFromAct
				.sendEmptyMessage(Config.GET_ATTENTION_MATCH_DONE_LIST_SUCCESS);
	}

	@Override
	public void getServerResponseFail(String serverRes) {
		handlerFromAct
				.sendEmptyMessage(Config.GET_ATTENTION_MATCH_DONE_LIST_FAIL);
	}

	@Override
	public void getServerResponseException() {
		handlerFromAct
				.sendEmptyMessage(Config.GET_ATTENTION_MATCH_DONE_LIST_EXCEPTION);
	}

	@Override
	protected int getShowState() {
		return AttentionGameInfo.SHOW_STATE_DONE;
	}

}
